= form_for(@credit_record) do |f|
  - if @credit_record.errors.any?
    #error_explanation
      %h2
        = pluralize(@credit_record.errors.count, "error")
        prohibited this credit_record from being saved:
      %ul
        - @credit_record.errors.full_messages.each do |message|
          %li= message
  %table.table.table-bordered
    %tr
      %td{style: "width:150px;"}
        %label 行业
      %td
        = f.text_field :industry, class: "form-control"
    %tr
      %td
        %label 被举报人
      %td
        = f.text_field :person_reported_against, class: "form-control"
    %tr
      %td
        %label 身份证号
      %td
        = f.text_field :citizen_id, class: "form-control"
    %tr
      %td
        %label 地址
      %td
        = f.text_field :address, class: "form-control"
    %tr
      %td
        %label 举报原因
      %td
        = f.text_area :reported_reason, class: "form-control"
    %tr
      %td
        %label 案发时间
      %td
        = f.text_field :time_of_incident, class: "form-control", id: "incident-daypicker"
    %tr
      %td
        %label 举报人
      %td
        = f.number_field :user_id, class: "form-control"
    %tr
      %td
        %label 状态
      %td
        = f.text_field :workflow_state, class: "form-control"

  -#
    .field
      = f.label :industry
      %label 行业
      %br/
      = f.text_field :industry
    .field
      = f.label :person_reported_against
      %label 被举报人
      %br/
      = f.text_field :person_reported_against
    .field
      = f.label :citizen_id
      %label 身份证号
      %br/
      = f.text_field :citizen_id
    .field
      = f.label :address
      %label 地址
      %br/
      = f.text_field :address
    .field
      = f.label :reported_reason
      %label 举报原因
      %br/
      = f.text_area :reported_reason
    .field
      = f.label :time_of_incident
      %label 案发时间
      %br/
      = f.date_select :time_of_incident
    .field
      = f.label :user_id
      %label 举报人
      %br/
      = f.number_field :user_id
    .field
      = f.label :workflow_state
      %label 状态
      %br/
      = f.text_field :workflow_state
  .actions{style: "float:left;margin-right:10px;"}
    = f.submit '提交', class: 'btn btn-primary'
    |

= javascript_include_tag '//cdn.bootcss.com/moment.js/2.10.6/moment.min.js'
= stylesheet_link_tag     '//ycpublic.oss-cn-beijing.aliyuncs.com/static/bootstrap-datetimepicker.css'
= javascript_include_tag     '//ycpublic.oss-cn-beijing.aliyuncs.com/static/bootstrap-datetimepicker.min.js'
:javascript
  $('#incident-daypicker').datetimepicker({
    format: 'yyyy-mm-dd',
    todayHighlight: true,
    startView:2,
    maxView:3,
    minView:2
  });
  $('#incident-daypicker').click(function(){
    $('.icon-arrow-left').addClass('glyphicon glyphicon-chevron-left')
    $('.icon-arrow-right').addClass('glyphicon glyphicon-chevron-right')
  });